package demo003.test00;
/**
 * 学习java注解
 * @author zanglaowei
 *
 */

@Kevin
public class demo003 {
	
	public static void showKevin(Class c) {
	  //打印类的名字
	  System.out.println(c.getName());
	  //是否存在注解
	  boolean isExist = c.isAnnotationPresent(Kevin.class);
  
	  if (isExist) {
		  System.out.println("---存在注解---");
	      Kevin kevin = (Kevin) c.getAnnotation(Kevin.class);
	      System.out.println(kevin.name());
	  }else
	  {
		  System.out.println("--不-存在注解---");
	  }
	}
	
	public static void main(String[] args) {
		
		demo003.showKevin(demo003.class);
	}
}
